package org.zsk.cs.util.common.enums;

import lombok.Getter;

/**
 * <p>
 *     邮箱主题
 * </p>
 *
 * @author zsk
 * @version 1.0
 * Created on 2020/4/20
 */
@Getter
public enum EmailSubject {
    BIND(0,"绑定"),
    UNBIND(1,"解绑"),
    RESETPASSWORD(2,"重置密码");
    /**
     * 数值
     */
    private int value;
    /**
     * 描述
     */
    private String desc;
    EmailSubject(int value, String desc) {
        this.value=value;
        this.desc=desc;
    }

    /**
     * 根据数值返回枚举
     * @param value 0 绑定 1 解绑
     * @return 枚举
     */
    public final static EmailSubject getByValue(int value){
        for (EmailSubject emailSubject:EmailSubject.values()
        ) {
            if (emailSubject.getValue() == value){
                return emailSubject;
            }
        }
        return null;
    }
}
